home *** CD-ROM | disk | FTP | other *** search
- <!-------------------------------------------------------------------------------------------------
- Copyright by Kofax Image Products
- -------------------------------------------------------------------------------------------------->
-
- <%@ LANGUAGE = VBScript %>
- <%
- Response.Expires = 60
- Response.Expiresabsolute = Now() - 1
- Response.AddHeader "pragma","no-cache"
- Response.AddHeader "cache-control","private"
- Response.CacheControl = "no-cache"
- if Application("PubTypesPath")="" then
- Dim Vroot,iCount,idx
- Vroot = Server.MapPath("Default.asp")
- iCount = 0
- idx = InStrRev(Vroot, "\")
- if (idx > 0) and (idx < len(Vroot)) then
- Vroot = Left(Vroot,idx-1)
- end if
- Application("PubTypesPath")=Vroot & "\PubTypes"
- Application("XMLDirectory")=Vroot & "\XMLBATCH"
- Application("SiteIDFile")=Vroot & "\siteid.txt"
- Application("LogFile")=Vroot & "\csweblog.txt"
- end if
- '---------------------------------------------------------------------------------------------------
- 'Getting local strings
- '--------------------------------------------------------------------------------------------------
-
- dim oConn,oRs,i,sFilePath,sLangTable
- dim display(8)
- on error resume next
- set oConn = Server.CreateObject("ADODB.Connection")
- sFilePath=Server.MapPath("csuiweb.mdb")
-
- oConn.Open("Driver={Microsoft Access Driver (*.mdb)};DBQ=" & sFilePath & ";")
- if err then
- set oConn=nothing
- err.clear
- Response.Redirect("Error.asp?Err=1")
- end if
- sLangTable=mid(Request.ServerVariables("HTTP_ACCEPT_LANGUAGE"),1,2)
- if trim("" & sLangTable)="" then
- sLangTable="En"
- end if
- Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=0")
- if (err and (Err.Number=-2147217865)) then
- err.Clear
- sLangTable="En"
- Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=0")
- end if
- Response.Write("<META HTTP-EQUIV='CONTENT-LANGUAGE' CONTENT='" & oRS("Value") & "'>")
- 'Create
- Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=6")
- display(0)=oRs("Value")
- 'Document name
- Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=31")
- display(1)=oRs("Value")
- 'Please wait....
- Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=8")
- display(2)=oRs("Value")
- 'Required index field message 1
- Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=32")
- display(3)=oRs("Value")
- 'Required index field message 2
- Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=33")
- display(4)=oRs("Value")
- 'Valid index field message 1
- Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=34")
- display(5)=oRs("Value")
- 'Valid index field message 2
- Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=35")
- display(6)=oRs("Value")
- 'The batch catalog may be changed. Please refresh Utility window for getting correct data and continuing...
- Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=36")
- display(7)=oRs("Value")
- 'Error on getting published data.ActiveX can not create component.
- Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=37")
- display(8)=oRs("Value")
-
- oRs.Close
- oConn.Close
- if err then
- err.clear
- Response.Redirect("Error.asp?Err=1")
- end if
- %>
- <html>
- <head>
- <script language="JavaScript">
- var iTimer;
- /*trim(StrIn) function is used for cutting all unnecessary black spaces*/
- function trim(StrIn)
- {
- var StrOut=StrIn;
- var s="";
- s=StrOut.charAt(0);
- while ((s == " ")&&(StrOut.length>0))
- {
- StrOut=StrOut.substr(1);
- s=StrOut.charAt(0);
- }
- s=StrOut.charAt(StrOut.length-1);
- while ((s == " ")&&(StrOut.length>0))
- {
- StrOut=StrOut.substring(0,StrOut.length-1);
- s=StrOut.charAt(StrOut.length-1);
- }
- return StrOut;
-
- }
- /*end of trim function*/
-
- /*--------------------------------------------------------------------------------------------*/
-
-
- /*
- CorrectStr(StrIn) function will replace all acute,quot characters of a string by "´", """ string
- Input: StrIn - a string
- Output:a string that is StrIn after replacing
- */
- function CorrectStr(StrIn)
- {
- var OS,i;
- OS=StrIn.replace("\'","´");
- i=OS.search("\'");
- while (i>=0)
- {
- OS=OS.replace("\'","´");
- i=OS.search("\'");
- }
- OS=OS.replace("\"",""");
- i=OS.search("\"");
- while (i>=0)
- {
- OS=OS.replace("\"",""");
- i=OS.search("\'");
- }
- return OS;
- }
- /*end of CorrectStr function*/
- /*--------------------------------------------------------------------------------------------*/
- /*
- ValidStr(StrIn) function will check that a string has got any substring "´" or """
- Input: StrIn - a string will be checked
- Output: true - if the string does not contain both "´" or """ substring
- false - if not
- */
- function ValidStr(StrIn)
- {
- var i;
- i=StrIn.indexOf("\´");
- if (i>=0)
- {
- return false;
- }
- i=StrIn.indexOf("\"");
- if (i>=0)
- {
- return false;
- }
- return true;
-
- }
- /* End of ValidStr function*/
-
- /*--------------------------------------------------------------------------------------------*/
-
- /*
- Function SubmitForm is used for sending all data of Utility window to Default window and calling its submitform method
- */
- function SubmitForm()
- {
- var Flag=true;
- var nTemp;
- //Checking valid input data
- if (parseInt(document.frmIndexField.IndexFieldNumber.value)>1)
- {
- for (nTemp=0;nTemp<document.frmIndexField.IndexFieldName.length;nTemp++)
- {
- document.frmIndexField.IndexFieldValue[nTemp].value=trim(document.frmIndexField.IndexFieldValue[nTemp].value);
- if ((document.frmIndexField.IndexFieldValue[nTemp].value=="")&&(document.frmIndexField.Required[nTemp].value=="True"))
- {
- alert(CorrectStr(document.frmIndexField.RequiredIFMsg1.value + " " + document.frmIndexField.IndexFieldName[nTemp].value + " " + document.frmIndexField.RequiredIFMsg2.value));
- document.frmIndexField.IndexFieldValue[nTemp].focus();
- Flag=false;
- break;
- }
- else
- {
- if (!ValidStr(document.frmIndexField.IndexFieldValue[nTemp].value))
- {
- alert(CorrectStr(document.frmIndexField.ValidIFMsg1.value + " " + document.frmIndexField.IndexFieldName[nTemp].value + " " + document.frmIndexField.ValidIFMsg2.value));
- document.frmIndexField.IndexFieldValue[nTemp].focus();
- Flag=false;
- break;
- }
-
- }
- }
- }
- else
- {
- if (parseInt(document.frmIndexField.IndexFieldNumber.value)==1)
- {
- document.frmIndexField.IndexFieldValue.value=trim(document.frmIndexField.IndexFieldValue.value);
- if ((document.frmIndexField.IndexFieldValue.value=="")&&(document.frmIndexField.Required.value=="True"))
- {
- alert(CorrectStr(document.frmIndexField.RequiredIFMsg1.value + " " + document.frmIndexField.IndexFieldName.value + " " + document.frmIndexField.RequiredIFMsg2.value));
- document.frmIndexField.IndexFieldValue.focus();
- Flag=false;
- }
- else
- {
- if (!ValidStr(document.frmIndexField.IndexFieldValue.value))
- {
- alert(CorrectStr(document.frmIndexField.ValidIFMsg1.value + " " + document.frmIndexField.IndexFieldName.value + " " + document.frmIndexField.ValidIFMsg2.value));
- document.frmIndexField.IndexFieldValue.focus();
- Flag=false;
- }
- }
- }
- }
- //end of checking valid data
- if (Flag)
- //All data are valid
- {
- //Giving data back to default page
- var s;
- //s contains all returned data
- //generating data that are contained in the s variant
-
- s="<input type='Hidden' name='BatchClassName' value='" + CorrectStr(document.frmIndexField.BatchClassName.value) + "'>";
- s=s + "<input type='Hidden' name='BatchClassID' value='" + CorrectStr(document.frmIndexField.BatchClassID.value) + "'>";
- s=s + "<input type='Hidden' name='Priority' value='" + CorrectStr(document.frmIndexField.Priority.value) + "'>";
- s=s + "<input type='Hidden' name='DocumentClassName' value='" + CorrectStr(document.frmIndexField.DocumentClassName.value) + "'>";
- s=s + "<input type='Hidden' name='FormTypeName' value='" + CorrectStr(document.frmIndexField.FormTypeName.value) + "'>";
- s=s + "<input type='Hidden' name='FixedPageCount' value='" + CorrectStr(document.frmIndexField.FixedPageCount.value) + "'>";
- // s=s + "<input type='Hidden' name='DocumentName' value='" + CorrectStr(document.frmIndexField.DocumentName.value) + "'>";
- s=s + "<input type='Hidden' name='DocumentName' value=''";
- s=s + "<input type='Hidden' name='BatchFieldNumber' value='" + CorrectStr(document.frmIndexField.BatchFieldNumber.value) + "'>";
- //Adding batch fields information
- if (parseInt(document.frmIndexField.BatchFieldNumber.value)==1)
- {
- s=s + "<input type='Hidden' name='BatchFieldName' value='" + CorrectStr(document.frmIndexField.BatchFieldName.value) + "'>";
- }
- else
- {
- if (parseInt(document.frmIndexField.BatchFieldNumber.value)>1)
- {
- for (nTemp=1;nTemp<parseInt(document.frmIndexField.BatchFieldNumber.value);nTemp++)
- {
- s=s + "<input type='Hidden' name='BatchFieldName' value='" + CorrectStr(document.frmIndexField.BatchFieldName[nTemp].value) + "'>";
- }
- }
- }
- //Adding index fields information
- s=s + "<input type='Hidden' name='IndexFieldNumber' value='" + CorrectStr(document.frmIndexField.IndexFieldNumber.value) + "'>";
- if (parseInt(document.frmIndexField.IndexFieldNumber.value)>1)
- { for (nTemp=0;nTemp<document.frmIndexField.IndexFieldName.length;nTemp++)
- {
- s=s + "<input type='Hidden' name='IndexFieldName' value='" + CorrectStr(document.frmIndexField.IndexFieldName[nTemp].value) + "'>";
- s=s + "<input type='Hidden' name='IndexFieldValue' value='" + CorrectStr(document.frmIndexField.IndexFieldValue[nTemp].value) + "'>";
- }
-
- }
- else
- {
- if (parseInt(document.frmIndexField.IndexFieldNumber.value)==1)
- {
- s=s + "<input type='Hidden' name='IndexFieldName' value='" + CorrectStr(document.frmIndexField.IndexFieldName.value) + "'>";
- s=s + "<input type='Hidden' name='IndexFieldValue' value='" + CorrectStr(document.frmIndexField.IndexFieldValue.value) + "'>";
- }
- }
- //End of generating
- //Submit form
- var oOpener = top.dialogArguments;
- oOpener.sTitle="<b><i>" + document.frmIndexField.ProcessingText.value + "</i></b>";
- oOpener.sFlag="<input type='Hidden' name='Submited' value='True'>"
- oOpener.sReturnData = s;
- oOpener.Update();
- top.close();
- return true;
- }
- else
- {
- return false;
- }
- }
-
- /* End of SubmitForm function*/
-
- /*------------------------------------------------------------------------------------------------*/
-
- /* SetFocus() function performs setting focus to the first text box*/
- function init()
- {
- iTimer=window.setInterval("SetFocus()",50);
- }
- function SetFocus()
- {
- if (document.frmIndexField.elements.length>0)
- {
- if (StoreData.innerHTML!="")
- {
- try
- {
- if (parseInt(document.frmIndexField.IndexFieldNumber.value)>0)
- {
- if (parseInt(document.frmIndexField.IndexFieldNumber.value)==1)
- {
- document.frmIndexField.IndexFieldValue.focus();
- }
- else
- {
- document.frmIndexField.IndexFieldValue[0].focus();
- }
- window.clearInterval(iTimer);
- }
- }
- catch (e)
- {
- }
- }
- else
- {
- window.clearInterval(iTimer);
- }
- }
- else
- {
- window.clearInterval(iTimer);
- }
- }
- </script>
- <title>Untitled</title>
- <link rel="stylesheet" href="coversheet.css">
-
- </head>
-
- <body bgcolor="#A1AED0" onload="init();" >
-
- <form target="_self" onsubmit="return SubmitForm();" action='UtilBody.asp?lang=<%=Request.QueryString("lang")%>' name="frmIndexField" method="post" >
- <%
- 'Checking changes of header page
- if Request.Form("selecteddata")="" then
- response.write("<div id='StoreData' style='visibility:hidden;'></div>")
- else
- dim oXML,nTemp,sBatch,sDocument,sForm
- Dim nB,nD,nF,bFlag,sTest
- on error resume next
- set oXML=CreateObject("RCXMLWEB.RCXMLUI")
- if err then
- response.write("<table><tr><td class='errorMessage'>" & display(8) & "</td></tr></table>")
- Response.End
- end if
- 'Used for getting sample image file
- ' nTemp=oXML.SetInfo(Application("PubTypesPath"),sWebRoot)
- 'getting batch catalog information
- nTemp=oXML.SetInfo(Application("PubTypesPath"))
- if nTemp<0 then
- dim fso,f
- Set fso = CreateObject("Scripting.FileSystemObject")
- set f =fso.OpenTextFile(Application("LogFile"),8,true)
- f.WriteLine oXML.ErrMessage
- f.Close
- set fso=nothing
- end if
- bFlag=False
- 'Checking the change
- for nB=1 to oXML.Batches.Count
- for nD=1 to oXML.Batches(nB).Documents.Count
- for nF=1 to oXML.Batches(nB).Documents(nD).FormTypes.Count
- sTest="" & oXML.Batches(nB).BatchClassID & "-" & oXML.Batches(nB).Documents(nD).DocumentClassName & "-" & oXML.Batches(nB).Documents(nD).FormTypes(nF).FormTypeName
- if (sTest=("" & Request.Form("selecteddata"))) then
- bFlag=true
- exit for
- end if
- next
- if bFlag=true then
- exit for
- end if
- next
- if bFlag=true then
- exit for
- end if
- next
- if bFlag=false then
- set oXML = nothing
- response.write("<table><tr><td class='errorMessage'>" & display(7) & "</td></tr></table>")
- response.write("<script language='JavaScript'>top.resizeBy (0,-50);</script> ")
- response.end
- end if
- %>
- <input type="Hidden" name="IndexFieldNumber" value='<%=oXML.Batches(nB).Documents(nD).FormTypes(nF).visibleIndexFields.Count%>'>
- <input type="Hidden" name="RequiredIFMsg1" value='<%=display(3)%>'>
- <input type="Hidden" name="RequiredIFMsg2" value='<%=display(4)%>'>
- <input type="Hidden" name="ValidIFMsg1" value='<%=display(5)%>'>
- <input type="Hidden" name="ValidIFMsg2" value='<%=display(6)%>'>
- <input type="Hidden" name="BatchClassName" value='<%=oXML.Batches(nB).BatchClassName%>'>
- <input type="Hidden" name="BatchClassID" value='<%=oXML.Batches(nB).BatchClassID%>'>
- <input type="Hidden" name="Priority" value='<%=oXML.Batches(nB).Priority%>'>
- <input type="Hidden" name="BatchFieldNumber" value='<%=oXML.Batches(nB).BatchFields.Count%>'>
- <%
- for nTemp=1 to oXML.Batches(nB).BatchFields.Count
- %>
- <input type="Hidden" name="BatchFieldName" value='<%=oXML.Batches(nB).BatchFields(nTemp).Name%>'>
- <input type="Hidden" name="BatchFieldValue" value='<%=oXML.Batches(nB).BatchFields(nTemp).Value%>'>
- <%
- next
- %>
- <input type="Hidden" name="DocumentClassName" value='<%=oXML.Batches(nB).Documents(nD).DocumentClassName%>'>
- <input type="Hidden" name="FormTypeName" value='<%=oXML.Batches(nB).Documents(nD).FormTypes(nF).FormTypeName%>'>
- <input type="Hidden" name="FixedPageCount" value='<%=oXML.Batches(nB).Documents(nD).FormTypes(nF).FixedPageCount%>'>
- <table border="0" cellpadding="0" cellspacing="1">
-
- <%
- for nTemp=1 to oXML.Batches(nB).Documents(nD).FormTypes(nF).visibleIndexFields.Count
- %>
- <tr>
- <td class="indexlabels"><%=oXML.Batches(nB).Documents(nD).FormTypes(nF).visibleIndexFields(nTemp).Name%>
- <input type="Hidden" name="IndexFieldName" value='<%=oXML.Batches(nB).Documents(nD).FormTypes(nF).visibleIndexFields(nTemp).Name%>'>
- <input type="Hidden" name="Required" value='<%=oXML.Batches(nB).Documents(nD).FormTypes(nF).visibleIndexFields(nTemp).Required%>'>
- <% if oXML.Batches(nB).Documents(nD).FormTypes(nF).visibleIndexFields(nTemp).Required=True then
- %>
- <font color="Red">*</font>
- <% end if%>
- </td>
- </tr>
- <tr>
- <td>
- <input type="Text" class="inputBox" name="IndexFieldValue" size="40" maxlength='<%=oXML.Batches(nB).Documents(nD).FormTypes(nF).visibleIndexFields(nTemp).MaxLength%>' >
- </td>
- </tr>
- <tr>
- <td height="3"></td>
- </tr>
- <%
- next
- set oXML=nothing
- %>
- <!---
- <tr>
- <td height="4" valign="midle"><hr color="Black" size="1"></td>
- </tr>
- <tr>
- <td class="indexlabels"><%=display(1)%></td>
- </tr>
- <tr>
- <td>
- <input type="Text" class="inputBox" name="DocumentName" size="40" maxlength="32">
- </td>
- </tr>
-
- --->
- <tr >
- <td height="4" valign="midle"><hr color="Black" size="1"></td>
- </tr>
- <tr>
- <td>
- <input type="Submit" name="Submit" value='<%=display(0)%>' >
- </td>
- </tr>
- </table>
- <div id="StoreData" style="visibility:hidden;">
- <input type="Hidden" name="selecteddata" value='<%=request.Form("selecteddata")%>'>
- </div>
- <%
- end if
- %>
- <input type="Hidden" name="ProcessingText" value='<%=display(2)%>'>
- </form>
- </body>
- </html>
-